export default{
    namespace : 'product',
    state : {
        productList:[
            {
                name : '火腿'
            },
            {
                name: '苹果'
            }
        ]
    },
    reducers:{
        updateList(state,action){
            console.log('ooo')
            let currentProductList = deepClone(state)
            currentProductList.productList.push(action.payload)
            return currentProductList
        }
    }
}

function deepClone(arr){
    let _obj = JSON.stringify(arr),
        objClone = JSON.parse(_obj)
    return objClone
}